public class Test3 {
    public static void main(String[] args) {
        Student[] student = new Student[5];

        student[0] = new Student("0001", "A", 90, 90, 90);
        student[1] = new Student("0002", "B", 80, 80, 80);
        student[2] = new Student("0003", "C", 70, 70, 70);

        student[3] = new StudentXW("0004", "D", 100, 100, 100, "学习委员");
        student[4] = new StudentBZ("0005", "E", 98, 70, 100, "班长");

        student[0].compare(student[1]);
    }
}

class Student {
    private String id;

    private String name;

    private int EnglishGrade;

    private int mathGrade;

    private int comGrade;

    public Student() {

    }

    public Student(String id, String name, int EnglishGrade, int mathGrade, int comGrade) {
        this.id = id;
        this.name = name;
        this.EnglishGrade = EnglishGrade;
        this.mathGrade = mathGrade;
        this.comGrade = comGrade;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getEnglishGrade() {
        return EnglishGrade;
    }

    public void setEnglishGrade(int englishGrade) {
        EnglishGrade = englishGrade;
    }

    public int getMathGrade() {
        return mathGrade;
    }

    public void setMathGrade(int mathGrade) {
        this.mathGrade = mathGrade;
    }

    public int getComGrade() {
        return comGrade;
    }

    public void setComGrade(int comGrade) {
        this.comGrade = comGrade;
    }

    public int sumOfGrade() {
        return this.getEnglishGrade() + this.getMathGrade() + this.getComGrade();
    }

    public int equals(Student s) {
        return this.sumOfGrade() - s.sumOfGrade();
    }

    public void compare(Student s) {
        if (this.sumOfGrade() == s.sumOfGrade()) {
            System.out.println("等于");
        } else if (this.sumOfGrade() > s.sumOfGrade()) {
            System.out.println("大于");
        } else {
            System.out.println("小于");
        }
    }

    public double testScore() {
        return this.sumOfGrade() / 3.0;
    }
}

class StudentXW extends Student {
    private String duty;

    public StudentXW() {

    }

    public StudentXW(String id, String name, int EnglishGrade, int mathGrade, int comGrade, String duty) {
        super(id, name, EnglishGrade, mathGrade, comGrade);
        this.duty = duty;
    }

    @Override
    public double testScore() {
        return this.sumOfGrade()/ 3.0 + 3;
    }
}

class StudentBZ extends Student {
    private String duty;

    public StudentBZ() {

    }

    public StudentBZ(String id, String name, int EnglishGrade, int mathGrade, int comGrade, String duty) {
        super(id, name, EnglishGrade, mathGrade, comGrade);
        this.duty = duty;
    }

    @Override
    public double testScore() {
        return this.sumOfGrade()/ 3.0 + 5;
    }
}